#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
using namespace std;
typedef long long ll;
const int mod=1e9+7;

int n,m;
char s[1005][1005];
int dp[1005][1005]; 

int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;i++) scanf("%s",s[i]+1);
	
	dp[1][1]=1;
	for (int i=1;i<=n;i++)
		for (int j=1;j<=m;j++) 
		if (s[i][j]=='.')
		{
			if (i==1&&j==1) continue;
			dp[i][j]=(dp[i-1][j]+dp[i][j-1])%mod;
		}
	printf("%d\n",dp[n][m]);
    return 0;
}
